--[[    slimui - Copyright (c) 2011 atom0s, All rights reserved.    See Copyright notice in slimui.lua    ]]--class 'MainMenu: Menu' { ... };----------------------------------------------------------------------------------
-- func: MainMenu.__init__
-- desc: Constructor called when this object is first created.
----------------------------------------------------------------------------------function MainMenu.__init__( self )    Menu.__init__( self );end----------------------------------------------------------------------------------
-- func: MainMenu:Create
-- desc: Creates a new mainmenu object.
----------------------------------------------------------------------------------function MainMenu:Create( parent )    if parent == nil or parent._object == nil then
        slimui:err( 'MainMenu:Create - parent must be set to create a control!' );
    end
    
    self._object = createMainMenu( parent._object );
    
    if self._object == nil then
        slimui:err( 'MainMenu:Create - failed to initialize a new object.' );
    end
    
    return self;end----------------------------------------------------------------------------------
-- func: MainMenu:Bind
-- desc: Binds this mainmenu object to the given mainmenu.
----------------------------------------------------------------------------------function MainMenu:Bind( menu )    if menu == nil then        slimui:err( 'MainMenu:Bind - parent menu cannot be nil!' );    end    local class = object_getClassName( list );    if string.lower( class ) ~= 'tmainmenu' then        slimui:err( 'MainMenu:Bind - cannot bind to objects that are not a mainmenu!' );    end    if self._object ~= nil then        object_destroy( self._object );    end    self._object = menu;    return self;end



--[[ Debug information. ]]--------------------------------------------------------
if ( slimui:isdebug() == true ) then
    slimui:msg( '(Control) mainmenu.lua successfully loaded.' );
end